import React,{Component} from 'react';
import {Select,Input,message} from 'antd';
import moment from 'moment';

const Option = Select.Option;

//基准下拉选择
const BenchmarkSelect=({dispatch,value,data,tag})=>{
	console.log('BDepartmentChoice',data,tag)
	const myProps={
		defaultValue:[],
		onChange:(v)=>{
			console.log('vvvv',v)
			if(v){
				dispatch({
					type:`${tag}/setState`,
					payload:{
						'benchmarkCode':v,
					}
				})
			}else{
				dispatch({
					type:`${tag}/setState`,
					payload:{
						'benchmarkCode':'',
					}
				})
			}
			
		},
		allowClear:true,
		placeholder:"请选择基准",
		style:{width:150}
	}
	return (
		<Select {...myProps}>
			{
				data.map((item,i)=><Option value={`${item.benchCode}`} key={i}>{item.benchCode}-{item.benchName}</Option>)
			}
		</Select>
	)
}

export {
	BenchmarkSelect
}